package com.google.android.gms.internal;

import android.app.Activity;
import android.os.IBinder;
import android.os.IInterface;
import android.os.RemoteException;
import com.google.android.gms.common.internal.Hide;
import com.google.android.gms.dynamic.zzn;
import com.google.android.gms.dynamic.zzp;
import com.google.android.gms.dynamic.zzq;

@Hide
@zzabh
public final class zzyp extends zzp<zzyt> {
    public zzyp() {
        super("com.google.android.gms.ads.AdOverlayCreatorImpl");
    }

    public final zzyq zze(Activity activity) {
        try {
            IBinder zzl = ((zzyt) zzdg(activity)).zzl(zzn.zzz(activity));
            if (zzl == null) {
                return null;
            }
            IInterface queryLocalInterface = zzl.queryLocalInterface("com.google.android.gms.ads.internal.overlay.client.IAdOverlay");
            return queryLocalInterface instanceof zzyq ? (zzyq) queryLocalInterface : new zzys(zzl);
        } catch (RemoteException | zzq e) {
            zzaky.zzc("Could not create remote AdOverlay.", e);
            return null;
        }
    }

    /* access modifiers changed from: protected */
    public final /* synthetic */ Object zze(IBinder iBinder) {
        if (iBinder == null) {
            return null;
        }
        IInterface queryLocalInterface = iBinder.queryLocalInterface("com.google.android.gms.ads.internal.overlay.client.IAdOverlayCreator");
        return queryLocalInterface instanceof zzyt ? (zzyt) queryLocalInterface : new zzyu(iBinder);
    }
}
